package com.ityedao.接口案例;

import java.util.ArrayList;

public class ClassManager {
    ArrayList<Student> students = new ArrayList<>();// 全班同学的一个容器
//    private StudentOperator studentOperator = new StudentOperatorImpl1();// 第一套方案
    private StudentOperator studentOperator = new StudentOperatorImpl2();// 第二套方案

    public ClassManager(){
        students.add(new Student("迪丽热巴", "女", 99));
        students.add(new Student("古力娜扎", "女", 100));
        students.add(new Student("马尔扎哈", "男", 88));
        students.add(new Student("艾玛和卓", "男", 60));
    }

    // 打印全班全部同学的信息
    public void printInfo(){
        studentOperator.printAllInfo(students);
    }

    // 打印全班同学的平均分
    public void printScore(){
        studentOperator.printAverageScore(students);
    }
}
